﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace GameTetris
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ButtonState == MouseButtonState.Pressed)
                DragMove();
        }

        private void winMinimize_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.WindowState = System.Windows.WindowState.Minimized;
        }

        private void winMaximize_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (this.WindowState == System.Windows.WindowState.Normal)
                this.WindowState = System.Windows.WindowState.Maximized;
            else
                this.WindowState = System.Windows.WindowState.Normal;

        }

        private void winClose_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }

        private void winResum_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ButtonState == MouseButtonState.Pressed)
            {
                winResum.Visibility = System.Windows.Visibility.Collapsed;
                winpause.Visibility = System.Windows.Visibility.Visible;
                winNewplay.Visibility = System.Windows.Visibility.Collapsed;
            }
        }

        private void winpause_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ButtonState == MouseButtonState.Pressed)
            {
                winpause.Visibility = System.Windows.Visibility.Collapsed;
                winResum.Visibility = System.Windows.Visibility.Visible;
                winNewplay.Visibility = System.Windows.Visibility.Collapsed;
            }
        }

        private void winSound_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {

        }

        private void winNewplay_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ButtonState == MouseButtonState.Pressed)
            {
                winNewplay.Visibility = System.Windows.Visibility.Collapsed;
                winpause.Visibility = System.Windows.Visibility.Visible;
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        { 
            winMinimize.Visibility = System.Windows.Visibility.Visible;
            winClose.Visibility = System.Windows.Visibility.Visible;
            winNewplay.Visibility = System.Windows.Visibility.Visible;
            winpause.Visibility = System.Windows.Visibility.Collapsed;
            winSound.Visibility = System.Windows.Visibility.Visible;
            winResum.Visibility = System.Windows.Visibility.Collapsed;
        }

        private void winExitBotton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }

    }
}
